<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 3.编程题：判断一个字符”a”是否出现在另一个字符”a2340sadfj2affa2”中。（考点：indexOf、if分支语句）
        let w = "a2340sadfj2affa2"
        if (w.indexOf("a") === 0) {
            console.log("有a");
        } else {
            console.log("没有a");
        }
    </script>
</body>

</html>